package com;

import com.util.DBtemp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/6/5 23:41
 * @since JDK 1.8
 */
@SpringBootApplication
@EnableScheduling
public class NoteApplication {

    public static void main(String[] args) {
        SpringApplication.run(NoteApplication.class,args);
    }

    @Autowired
    private DBtemp dBtemp;

    //3.添加定时任务
    @Scheduled(cron = "0 0/5 * * * ?")
    //或直接指定时间间隔，例如：5秒
    //@Scheduled(fixedRate=5000)
    private void configureTasks() {

       dBtemp.tempDB();
    }


}
